package com.chinalife.vote;

import com.chinalife.vote.utils.CacheUtils;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@SpringBootApplication
@EnableConfigurationProperties
@RestController
@MapperScan("com.chinalife.**.mapper")
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        log.info("====vote is running=====");
    }

    @RequestMapping("/ok")
    public String ok(){
        CacheUtils.saveString("vote:test","test123");
        String test1 = CacheUtils.getString("vote:test");
        String test2 = CacheUtils.getString("vote:test1");
        System.out.println(test1);
        System.out.println(test2);
        return "ok";
    }

}
